package com.ciaojian.client.service;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ciaojian.core.mapper.UserTimesCardMapper;
import com.ciaojian.core.model.UserTimesCard;
import com.ciaojian.core.service.UserTimesCardService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author oxiny
 */
@Service
public class UserTimesCardServiceImpl<M extends BaseMapper<T>, T> extends UserTimesCardService<UserTimesCardMapper, UserTimesCard> {

    /**
     * 根据用户ID和门店查询用户可用次卡
     *
     * @param userId       用户ID
     * @param storeId      门店ID
     * @param serviceTitle 服务标题
     * @return 用户可用次卡
     */
    public List<UserTimesCard> listUserTimesCardUsable(Integer userId, Integer storeId, String serviceTitle) {
        return this.baseMapper.listUserTimesCardUsable(userId, storeId, serviceTitle);
    }

    /**
     * 查询用户次卡
     *
     * @param userId 用户ID
     * @return 用户次卡
     */
    public List<UserTimesCard> listUserTimesCard(Integer userId) {
        return this.baseMapper.getByUserId(userId);
    }
}
